import request from "@/utils/discovery/request";

export interface choiseMdeol {
  id: string;
  name: string;
  isCheck?: boolean;
}
// 二级分类
export interface properMdeol {
  choises: choiseMdeol[];
  formType: string;
  label: string;
  name: string;
  style: string;
  valueType: string;
}
type properMdeols = properMdeol

// 视频类型
interface contentMdeol {
  activityTotalDays: number;
  aiyigeApplication: string;
  algorithmSortValue: number;
  avocationTags: [];
  channel: string;
  cityId: string;
  cityName: string;
  commodityBackup: object;
  cover: string[];
  createTime: number;
  creator: string;
  creatorBackup: object;
  difficultDegreeValue: number;
  editHighestVersion: string;
  enclosureCount: number;
  favorableValue: number;
  id: string;
  initExposureNum: number;
  inventoryBackup: object;
  maxP: number;
  mediaSummary: object;
  momentClassificationBackup: object;
  momentId: string;
  moreBackup: object;
  needPromotion: number;
  notVipPromotion: number;
  num: number;
  onSalesBackup: object;
  onsellTime: number;
  onsellUpdateTime: number;
  otherTags: [];
  popTrainingIndex: number;
  recDegree: number;
  receiptsAmountCapacity: number;
  recentFavorableValue: number;
  router: string;
  statisticsBackup: object;
  status: string;
  subject: string;
  tags: [];
  title: string;
  updateTime: number;
  version: number;
  vipPromotion: number;
  vipTag: object;
}

export interface collectMdeol {
  content: [];
  first: boolean;
  last: boolean;
  number: number;
  numberOfElements: number;
  offset: null;
  size: number;
  sort: null;
  statistics: {
    minScore: null;
    totalDiscountCourse: number;
    totalVipPrivilegeCount: number;
    searchSuggest: null;
  };
  totalElements: number;
  totalPages: number;
  useOffset: boolean;
}

export default {
  // 初始化二级分类 /moment/properties/filter/vip_zone?access_token=c494ae44-3adc-48ca-8749-5128a53358d7
  properties(token = "c494ae44-3adc-48ca-8749-5128a53358d7") {
    return request.get<any, properMdeol[]>(
      `/label`
    );
  },
  // 初始化视频 /moment/moments/collect/vip_zone/integrated?access_token=c494ae44-3adc-48ca-8749-5128a53358d7&pageSize=20&pageNum=0
  collect(
    pageSize: number,
    pageNum: number,
    tagType = 'integrated',
    data={},
    token = "c494ae44-3adc-48ca-8749-5128a53358d7"
  ) {
    return request.get<any, collectMdeol>(
      `/video`
    );
  },
  // 主题
  theme(){
    return request.get<any,collectMdeol>(`/theme`)
  }
};
